<template>
  <h3>子组件</h3>
  <button @click="sendFuFn">向父组件传值</button>
  <button @click="$parent.getData('子组件向父组件传值2')">想父组件传值2</button>
  <div></div>
</template>
<script setup>
import { ref, defineEmits, inject, provide } from "vue";
const zuData = inject("zuData");
const emit = defineEmits(["getData"]);
function sendFuFn() {
  emit("getData", "子组件向父组件传值1");
  console.log(zuData);
  //   provide("sonDatas", "123456");
}
</script>
